#define _CRT_SECURE_NO_WARNINGS 1

#include "singleList.h"

int main()
{
	struct Node* n1 = (struct Node*)malloc(sizeof(struct Node));
	assert(n1);

	struct Node* n2 = (struct Node*)malloc(sizeof(struct Node));
	assert(n2);

	struct Node* n3 = (struct Node*)malloc(sizeof(struct Node));
	assert(n3);

	struct Node* n4 = (struct Node*)malloc(sizeof(struct Node));
	assert(n4);

	struct Node* n5 = (struct Node*)malloc(sizeof(struct Node));
	assert(n5);

	//n1 = NULL;

	n1->val = 1;
	n2->val = 2;
	n3->val = 3;
	n4->val = 4;
	n5->val = 5;

	n1->next = n2;
	n2->next = n3;
	n3->next = n4;
	n4->next = n5;
	n5->next = NULL;

	n1->random = NULL;
	n2->random = n1;
	n3->random = n5;
	n4->random = n3;
	n5->random = n1;

	struct Node* phead = n1;
	singleListPrint(phead);
	//singleListPriRan(phead);

	struct Node* ret = copyRandomList(phead);
	singleListPrint(ret);
	//singleListPriRan(ret);

	return 0;
}

